<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Vue.set</title>
    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>
<body>
    <h1>Vue.set</h1>
    <hr>
    <div id="app">
        {{count}}
        <ul>
            <li v-for="item in arr">{{item}}</li>
        </ul>
        
    </div>
    <p><button onclick="add()">add</button></p>
    <script type="text/javascript">
        function add(){
            //Vue.set(outData,'count',2)
            //outData.count++;
            //app.arr[1]='ddd'
            Vue.set(app.arr,1,'dd')
        }
        var outData={
            count:1,
            //goods:'car'
            arr:['aaa','bbb','ccc']
        }
        var app = new Vue({
            el:'#app',
            data:outData

        })
    </script>
</body>
</html>